package edu.zqu.instructionalMatters.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import edu.zqu.instructionalMatters.project.entity.TeachingGroup;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author 何文东
 * @Date 2020-07-03
 * @Description: 课程组 - Mapper 接口
 * @Version 1.0
 */
public interface TeachingGroupMapper extends BaseMapper<TeachingGroup> {
    @Select("<script>" + "select * from teaching_group where college_id = #{collegeId} " +
            " <if test = 'courseId != null'>" +
            " and course_id = #{courseId}" +
            " </if>" +
            " <if test = 'teacherId != null'>" +
            " and teacher_id = #{teacherId}" +
            " </if>" +
            "</script>")
    public List<TeachingGroup> findAll(TeachingGroup teachingGroup);
}
